package com.yunji.product.service.impl;

import com.yunji.product.dao.IProductBrandDao;
import com.yunji.product.domain.BrandDO;
import com.yunji.product.params.BrandParam;
import com.yunji.product.service.IProductBrandService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.product.service.impl
 * @Title: ProductBrandServiceImpl
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-14 10:09:37      V1.0        HuaAo       新建类
 */
@Service
public class ProductBrandServiceImpl implements IProductBrandService {

    @Resource
    IProductBrandDao productBrandDao;

    @Override
    public boolean create(BrandDO brand) {
        return productBrandDao.save(brand);
    }

    @Override
    public List<BrandDO> search(BrandParam param) {
        return productBrandDao.search(param);
    }

    @Override
    public boolean update(BrandDO brand) {
        return productBrandDao.updateById(brand);
    }

    @Override
    public void delete(Long... ids) {
        productBrandDao.removeByIds(Arrays.asList(ids));
    }

    @Override
    public BrandDO select(Long id) {
        return productBrandDao.getById(id);
    }

    @Override
    public BrandDO getCacheById(Long id) {
        return productBrandDao.getById(id);
    }

}